package com.banyuan.lesson.输入输出流;

import java.io.FileInputStream;
import java.io.IOException;

/*
 * 文件字节输入流
 * 一次读一个数据；
 * */
public class TestFIleInputStream {
    public static void main(String[] args) {
        try (FileInputStream in = new FileInputStream("aaa.txt")) {
            int i;
            //一个经典的写法；
            while ((i = in.read()) != -1) {
                System.out.println((char) i);
            }
        } catch (IOException e) {
            e.printStackTrace();
        }

    }

}
